<template>
	<view>

		{{ $store.state.name }} --- {{ count }}
		<button @click='addClick'>增加</button>
	</view>
</template>

<script>
	import {mapState,mapMutations} from 'vuex'
	export default {
		data() {
			return {
				
			}
		},
		computed: {
			...mapState(['count'])
		},
		methods: {
			...mapMutations(['add']),
			addClick(){
				// this.$store.commit('add',10)
				this.add(5)
			}
		}
	}
</script>

<style>

</style>
